package mysql

import (
	"gorm.io/gorm"
)

type Warehouse struct {
	gorm.Model
	WarehouseUid  string  `gorm:"type:varchar(20);not null;comment:入库单号"`
	Source        string  `gorm:"type:varchar(10);not null;comment:单据类型"`
	WarehouseName string  `gorm:"type:varchar(24);not null;comment:仓库"`
	WarehouseNum  int64   `gorm:"type:int(11);not null;comment:入库数量"`
	Price         float64 `gorm:"type:decimal(10,2);not null;comment:入库金额"`
	Name          string  `gorm:"type:varchar(20);not null;comment:制单人"`
}

func (w *Warehouse) WarehouseAdd() error {
	return DB.Debug().Create(&w).Error
}

/*
func (w *Warehouse) WarehouseList(warehouseName string) ([]Warehouse, error) {
	var warehouse []Warehouse
	err := DB.Debug().Where("warehouseName = ?", warehouseName).Find(&warehouse).Error
	return warehouse, err
}
*/
